package mts.groupdispatcher;

import mts.constants.Direction;

public class FloorRequest {
	private byte floor;
	private Direction direction;
	
	public FloorRequest(byte floor, Direction direction) {
		this.floor = floor;
		this.direction = direction;
	}
	
	public byte getFloor() {
		return floor;
	}
	public void setFloor(byte floor) {
		this.floor = floor;
	}
	public Direction getDirection() {
		return direction;
	}
	public void setDirection(Direction direction) {
		this.direction = direction;
	}

	@Override
	public int hashCode() {
		return floor + (direction.getByteValue() >> 8);
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof FloorRequest)) {
			return false;
		}
		
		FloorRequest other = (FloorRequest)obj;
		return other.floor == floor && other.direction == direction;
	}

	@Override
	public String toString() {
		return "FloorRequest [floor: " + floor + ", direction: " + direction + "]";
	}
	
	
	
	
}
